Add reads of MacStumbler.
authorrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Tue, 8 Nov 2005 21:34:03 +0000 (21:34 +0000)
committerrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Tue, 8 Nov 2005 21:34:03 +0000 (21:34 +0000)
gpsbabel/netstumbler.c
gpsbabel/readme.xml

index aa0d52b7dfa8c877386ae892f36ebd11fda61830..241428558c0902a78be5963118302a95bd4f9e0e 100644 (file)
@@ -1,7 +1,7 @@
 /*
     Read Netstumbler data files.
 
-    Copyright (C) 2004 Robert Lipe, robertlipe@usa.net and
+    Copyright (C) 2004, 2005 Robert Lipe, robertlipe@usa.net and
     John Temples; gpsns@xargs.com
 
     This program is free software; you can redistribute it and/or modify
@@ -30,6 +30,7 @@ static char *nsneicon = NULL;
 static char *seicon = NULL;
 static char *sneicon = NULL;
 static char *snmac = NULL;
+static int macstumbler;
 
 static void    fix_netstumbler_dupes(void);
 
@@ -53,6 +54,7 @@ static void
 rd_init(const char *fname)
 {
        file_in = xfopen(fname, "r", MYNAME);
+       macstumbler = 0;
 }
 
 static void
@@ -91,6 +93,14 @@ data_read(void)
                                tm.tm_mday = atoi(&ibuf[20]);
                        }
 
+                       /*
+                        * Mac stumbler files are the same, except
+                        * use DDMM.mmm instad of DD.DDDD.
+                        */
+                       if (strstr(ibuf, "Creator: MacStumbler")) {
+                               macstumbler = 1;
+                       }
+
                        continue;
                }
 
@@ -104,12 +114,18 @@ data_read(void)
                                        lat = atof(&field[2]);
                                        if (field[0] == 'S')
                                                lat = -lat;
+                                       if (macstumbler) {
+                                               lat = ddmm2degrees(lat);
+                                       }
                                        break;
 
                                case 1:                         /* long */
                                        lon = atof(&field[2]);
                                        if (field[0] == 'W')
                                                lon = -lon;
+                                       if (macstumbler) {
+                                               lon = ddmm2degrees(lon);
+                                       }
                                        break;
 
                                case 2:                         /* ( SSID ) */
index 8c5a69b77edf9bb3740475550c23247f9310901e..6711e11108cfc028a92285dd39b9172b07c4fa1f 100644 (file)
@@ -285,6 +285,8 @@ of your original road layer.  Note that the ! is a shell metacharacter
 in bash and possibly other shells, so you may have to use single
 quotes or some other escape mechanism.
 </para>
+       <para>There is a tutorial <ulink url="http://www.gpsbabel.org/formats/delorme-new-interstate/"> how to create an onramp for a limited access highway in Street Atlas USA using GPSBabel.</ulink>
+       </para>
     </section>
 
     <section id="baroiq">
@@ -1105,6 +1107,7 @@ SSID in the description.  Different icons are assigned to encrypted,
 non-encrypted, stealth, and non-stealth access points; these may be
 changed with options. Import only.
 </para>
+<para>This format also works with MacStumbler.</para>
       <para> Additional options:</para>
       <para>
             <option>nsneicon</option> - Name of icon used for